/**

设计一个算法，计算出n阶乘中尾部零的个数
您在真实的面试中是否遇到过这个题？
样例

11! = 39916800，因此应该返回 2

*/

#include <bits/stdc++.h>

using namespace std;

/*
     * @param n: A long integer
     * @return: An integer, denote the number of trailing zeros in n!
     */
long long trailingZeros(long long n)
{
    // write your code here, try to do it without arithmetic operators.
    long long num = 0, i = 1, p;
    while(n >= (p = pow(5,i)))
    {
        num += n/p;
        i++;
    }
    return num;
}

int main(){
    long long n;
    scanf("%lld", &n);
    printf("%lld", trailingZeros(n));
    return 0;
}
